<?php

/**
 * Module's bootstrap file.
 * Notice the bootstrap class' name is "Modulename_"Bootstrap.
 * When creating your own modules make sure that you are using the correct namespace
 */
 class chat_Bootstrap extends Zend_Application_Module_Bootstrap
 {

     protected function _bootstrap($resource = null)
     {
         //Now let's parse the module specific configuration
         //Path might change however this is probably the one you won't ever need to change...
         //And also don't forget to use the current staging environment by sending the APP_ENV parameter to the Zend_Config
         $_conf = SGN_Application::getConfig($this->getModuleName(), 'application');
         $this->_options = array_merge($this->_options, $_conf->toArray()); //Let's merge the both arrays so that we can use them together...
         parent::_bootstrap($resource); //Well our custom bootstrap logic should end with the actual bootstrapping, now that we have merged both configs, we can go on...
     }

     protected function _initMyModule()
     {
//          $_isEnabled = $this->_options['custom']['config']['enabled'];
//          if ($_isEnabled != 1) {
//              throw new Exception($this->_options[$this->_options["language"]["selected"]]["error_message"]);
//          }
     }

     protected function _initModuleLangArray()
     {
         //Now let's define our language array to the registry so that we can use it...
         //Notice I have added "Custom_" prefix to the registry to avoid any conflicts with other modules...
         Zend_Registry::set("Custom_language", $this->_options[$this->_options["language"]["selected"]]);
     }
 }